import {observable, action} from 'mobx';
import localMenuData from 'Components/layout/localMenuData';

class Layout {
	@observable menuData = localMenuData;
	@observable currentMode = window.localStorage.getItem('currentMode') || 'default';
	@observable layoutConfig = {
		notMultModes: false,
		notShowFoot: false,
		notTopMenu: false,
		notShowBread: false,
	};

	@action changeMenuData(params){
		this.menuData = params;
	}
	@action changeMode(params){
		const list = Object.keys(localMenuData);
		if (list.indexOf(params) > -1) {
			this.currentMode = params;
			window.localStorage.setItem('currentMode', params);
		}
	}
	@action changeLayout(params){
		console.log('change');
	}
}

export default new Layout();
